package com.cy.aliyun_vod_upload;

import com.alibaba.sdk.android.vod.upload.model.UploadFileInfo;
import com.alibaba.sdk.android.vod.upload.model.VodInfo;
import com.google.gson.Gson;

import java.util.HashMap;

public class ParamUtils {

    public static VodInfo map2VodInfo(HashMap<String, Object> vodInfoJson) {
        Gson gson = new Gson();
        String json = gson.toJson(vodInfoJson);
        return gson.fromJson(json, VodInfo.class);
    }

    public static UploadFileInfo map2UploadFileInfo(HashMap<String, Object> uploadFileInfoJson) {
        Gson gson = new Gson();
        String json = gson.toJson(uploadFileInfoJson);
        return gson.fromJson(json, UploadFileInfo.class);
    }

    public static String toJson(Object object) {
        Gson gson = new Gson();
        return gson.toJson(object);
    }
}
